package com.yanmaohu.nikita.data.structure;

import com.yanmaohu.nikita.data.expression.NameExpression;

import java.util.List;

/**
 * @author Bright Lee
 */
public final class StructureInstance {

    private int beginIndex;
    private int endIndex;
    private List<NameExpression> structureName;
    private List<MemberInstance> structureInstanceBody;

    public StructureInstance(int beginIndex,
                             int endIndex,
                             List<NameExpression> structureName,
                             List<MemberInstance> structureInstanceBody) {
        this.beginIndex = beginIndex;
        this.endIndex = endIndex;
        this.structureName = structureName;
        this.structureInstanceBody = structureInstanceBody;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public int structureNameSize() {
        return structureName.size();
    }

    public NameExpression getStructureNameElement(int index) {
        return structureName.get(index);
    }

    public int structureInstanceBodySize() {
        return structureInstanceBody.size();
    }

    public MemberInstance getStructureInstanceBodyElement(int index) {
        return structureInstanceBody.get(index);
    }

}
